# -*- coding: utf-8 -*-
"""
Created on Tue Jul  9 20:46:57 2024

@author: Volta
"""
from time import sleep

user_input = float(input("What number do you want to find the square root of?"))
power = int(input("how many decimal places accuracy do you want?"))

g = user_input/2

print("My guess is", g)

while abs(g**2 - user_input) > .1**power:
    print("Narrowing guess range...")
    sleep(.75)
    g = (g + user_input/g)/2
    print ("My new guess is", g)
    sleep(.75)
    print("Checking guess...")
    sleep(.75)

g = round(g, power)

print ("your square root is approximately", g)